import axios from "axios";

const http = axios.create({
    baseURL: '/api',
    timeout: 3000,
})

function getHttp(url: string, data?: any) {
    return http.get(url, {
        params: data
    })
}

function delHttp(url: string, data?: any) {
    return http.delete(url, {
        params: data
    })
}

function postHttp(url: string, data?: any) {
    return http.post(url, data)
}

function putHttp(url: string, data?: any) {
    return http.put(url, data)
}

export {
    getHttp,
    putHttp,
    delHttp,
    postHttp,
}

export default http;